﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Option.aspx.cs" Inherits="MsgCenter.Web.Pages.User.Option"
    MasterPageFile="~/Option.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headContent" runat="server">
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/jqGrid/myJqgrid.js") %>"></script>
    <script type="text/javascript">
        jQuery(function ($) {
            $(".date-picker").datepicker({
                language: "zh-CN",
                autoclose: true, //选中之后自动隐藏日期选择框
                clearBtn: true, //清除按钮
                todayBtn: true, //今日按钮
                format: "yyyy-mm-dd"
            }).next().on(ace.click_event, function () {
                $(this).prev().focus();
            }); 
        });
        var txtName_ID = "<%=txtName.ClientID %>";
        var txtUserName_ID = "<%=txtUserName.ClientID %>";
        var txtPassword_ID = "<%=txtPassword.ClientID %>";
        var txtDeptName_ID = "<%=txtDeptName.ClientID %>";
        var hidDeptID_ID = "<%=hidDeptID.ClientID %>";
        var txtBirthDay_ID = "<%=txtBirthDay.ClientID %>";
        var txtCode_ID = "<%=txtCode.ClientID %>";
        //******************************** 校验必填项 ********************************
        function CheckSubmit() {
            var CheckResult = CheckValue();
            if (CheckResult == 'success') {
                return true;
            }
            else {
                showDialogMessage(CheckResult);
                return false;
            }
        }
        function CheckValue() {
            if ($('#' + txtName_ID).val() == "") {
                $('#' + txtName_ID).focus();
                return "姓名必须填写！";
            }
            if ($('#' + txtDeptName_ID).val() == "") {
                $('#' + txtDeptName_ID).focus();
                return "请先选择部门名称！";
            }
            if ($('#' + txtUserName_ID).val() == "") {
                $('#' + txtUserName_ID).focus();
                return "登录名必须填写！";
            }
            if ($('#' + txtPassword_ID).val() == "") {
                $('#' + txtPassword_ID).focus();
                return "密码必须填写！";
            }
            if ($('#' + txtCode_ID).val() == "") {
                $('#' + txtCode_ID).focus();
                return "用户工号必须填写！";
            }
            if ($('#' + txtBirthDay_ID).val() == "") {
                $('#' + txtBirthDay_ID).focus();
                return "出生日期必须填写！";
            }
            return "success";
        }
        //******************************** 校验必填项 ********************************
        //******************************** 提示信息 ********************************
        function AlertMessage(message) { alert(message); }
        function Close_Reload() {
            window.parent.CBClose_Load();
        }
        //******************************** 提示信息 ********************************
        function SelectDept() {
            $.colorbox({ innerWidth: "300px", innerHeight: "340px", iframe: true, overlayClose: false, opacity: 0.5, title: "部门选择", href: "../../Pages/DeptManage/SelectDept.aspx?type=Add" });
            return false;
        }
        function SelectDeptValue(varDeptName, varDeptID) {
            $.colorbox.close();
            $('#' + txtDeptName_ID).val(varDeptName);
            $('#' + hidDeptID_ID).val(varDeptID);
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="mailContent">
    <table width="660px" cellpadding="0" cellspacing="0">
        <tr>
            <td width="80px" align="right" height="35px">
                <font color="red">*</font>&nbsp;姓名:
            </td>
            <td width="240px" align="left">
                <input type="text" id="txtName" runat="server" class="col-xs-10 col-sm-5" style="width: 200px" />
            </td>
            <td width="80px" align="right">
                <font color="red">*</font>&nbsp;所属部门:
            </td>
            <td width="240px" align="left">
                <div class="input-group">
                    <input type="text" id="txtDeptName" runat="server" onclick="return SelectDept();" />
                    <button type="button" class="btn btn-purple btn-sm" onclick="return SelectDept();">
                        选择 <i class="icon-search bigger-110"></i>
                    </button>
                    <input type="hidden" id="hidDeptID" runat="server" />
                </div>
            </td>
        </tr>
        <tr>
            <td width="80px" align="right" height="35px">
                <font color="red">*</font>&nbsp;登录名:
            </td>
            <td width="240px" align="left">
                <input type="text" id="txtUserName" runat="server" placeholder="" class="col-xs-10 col-sm-5"
                    style="width: 200px" />
            </td>
            <td width="80px" align="right">
                <font color="red">*</font>&nbsp;密码:
            </td>
            <td width="240px" align="left">
                <input type="text" id="txtPassword" runat="server" placeholder="" class="col-xs-10 col-sm-5"
                    style="width: 200px" />
            </td>
        </tr>
        <tr>
            <td width="80px" align="right" height="35px">
               <font color="red">*</font>&nbsp;用户工号:</td>
            <td width="240px" align="left">
                <input type="text" id="txtCode" runat="server" placeholder="" class="col-xs-10 col-sm-5"
                    style="width: 200px" /></td>
            <td width="80px" align="right">
                &nbsp;</td>
            <td width="240px" align="left">
                &nbsp;</td>
        </tr>
        <tr>
            <td width="80px" align="right" height="35px">
                手机:
            </td>
            <td width="240px" align="left">
                <input type="text" id="txtMobile" runat="server" placeholder="" class="col-xs-10 col-sm-5"
                    style="width: 200px" />
            </td>
            <td width="80px" align="right">
                邮箱:
            </td>
            <td width="240px" align="left">
                <input type="text" id="txtEmail" runat="server" placeholder="" class="col-xs-10 col-sm-5"
                    style="width: 200px" />
            </td>
        </tr>
        <tr>
            <td width="80px" align="right" height="35px">
                Rtx登录名:
            </td>
            <td width="240px" align="left">
                <input type="text" id="txtRtxLoginName" runat="server" placeholder="" class="col-xs-10 col-sm-5"
                    style="width: 200px" />
            </td>
            <td width="80px" align="right">
                微信:
            </td>
            <td width="240px" align="left">
                <input type="text" id="txtWebChat" runat="server" placeholder="" class="col-xs-10 col-sm-5"
                    style="width: 200px" />
            </td>
        </tr>
        <tr>
            <td width="80px" align="right" height="35px">
                是否管理员:
            </td>
            <td width="240px" align="left">
                <input name="chkIsAdmin" id="chkIsAdmin" runat="server" class="ace ace-switch ace-switch-5"
                    type="checkbox" />
                <span class="lbl"></span>
            </td>
            <td width="80px" align="left">
                出生日期:
            </td>
            <td width="240px" align="left">
                <div class="input-group">
                    <input class="form-control date-picker" id="txtBirthDay" runat="server" type="text" data-date-format="yyyy-mm-dd" /><span
                        class="input-group-addon"> <i class="icon-calendar bigger-110"></i></span>
                </div>
            </td>
        </tr>
        <tr>
            <td width="80px" align="right" height="35px">
                所属角色:
            </td>
            <td align="left" colspan="3" style="width: 480px">
                <asp:ListBox ID="listRole" runat="server" Height="240px" SelectionMode="Multiple"
                    Width="200px"></asp:ListBox>
                <div class="red">
                    按住Ctrl键进行多选和取消
                </div>
            </td>
        </tr>
    </table>
    <div style="text-align: center">
        <asp:LinkButton ID="linkSave" runat="server" CssClass="btn btn-info" OnClientClick="return CheckSubmit();"
            OnClick="linkSave_Click" Visible="false"><i class="icon-ok bigger-110"></i>保存</asp:LinkButton>
        &nbsp;&nbsp;
        <button class="btn" onclick="window.parent.CBClose();return false;">
            <i class="icon-undo bigger-110"></i>取消
        </button>
    </div>
</asp:Content>
